package com.liu.susu.pojo;

import javax.persistence.*;
import java.util.Objects;

@NamedQuery(name = "testNamedQuery",query = "select d from com.liu.susu.pojo.Dog d")
@Entity
public class Dog {
    private int dogNum;
    private String dogName;
    private String dogKind;
    private Integer dogAge;
    private String decision;


    public Dog(){

    }

    public Dog(int dogNum, String dogName) {
        this.dogNum = dogNum;
        this.dogName = dogName;
    }

    @Id
    @Column(name = "dog_num")
    public int getDogNum() {
        return dogNum;
    }

    public void setDogNum(int dogNum) {
        this.dogNum = dogNum;
    }

    @Basic
    @Column(name = "dog_name")
    public String getDogName() {
        return dogName;
    }

    public void setDogName(String dogName) {
        this.dogName = dogName;
    }

    @Basic
    @Column(name = "dog_kind")
    public String getDogKind() {
        return dogKind;
    }

    public void setDogKind(String dogKind) {
        this.dogKind = dogKind;
    }

    @Basic
    @Column(name = "dog_age")
    public Integer getDogAge() {
        return dogAge;
    }

    public void setDogAge(Integer dogAge) {
        this.dogAge = dogAge;
    }

    @Basic
    @Column(name = "decision")
    public String getDecision() {
        return decision;
    }

    public void setDecision(String decision) {
        this.decision = decision;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Dog dog = (Dog) o;
        return dogNum == dog.dogNum && Objects.equals(dogName, dog.dogName) && Objects.equals(dogKind, dog.dogKind) && Objects.equals(dogAge, dog.dogAge) && Objects.equals(decision, dog.decision);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dogNum, dogName, dogKind, dogAge, decision);
    }
}
